<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
            background-color: #ccc;
        }
    </style>

</head>

<body>
    <h3>事件处理</h3>
    <h4>快捷方式</h4>
    <div class="box"></div>
    <script src="./jquery-3.6.0.js"></script>
    <script>
        $(".box").click(function () {
            let a = Math.floor(Math.random() * 255)
            let b = Math.floor(Math.random() * 255)
            let c = Math.floor(Math.random() * 255)
            $(this).css('backgroundColor', `rgb(${a},${b},${c})`)
        })

        //1回调函数，未来时间点
        //console.log(this);//2函数neibuthis 还是原生dom节点
        //$(this) //3 如果非要用jq方法  需要进行转换
    </script>
</body>

</html>